import {
	toast
} from '@/utils/toast';
// const userinfo = localStorage.getItem('userinfo')
const state = {
	userinfo: {},
	isLogin: false,
	Shopping: {},
    MAP:{},
	positioning:{},
    LIST:{}


}
// 这里的getters 只负责对外提供数据，不负责修改数据 如果要修改state中的数据 去使用mutations
const getters = {

}
const mutations = {
	LOGIN_INFO: (state, info) => {
		state.userinfo = info;
		state.isLogin = true;
		uni.setStorage({
			key: 'userinfo',
			data: info
		})
	},
	Shopping: (state, info) => {
		state.Shopping = info;
		uni.setStorage({
			key: 'Shopping',
			data: info
		})
	},
	MAP: (state, info) => {
		state.MAP = info;
		uni.setStorage({
			key: 'MAP',
			data: info
		})
	},
	positioning: (state, info) => {
		state.positioning = info;
		uni.setStorage({
			key: 'positioning',
			data: info
		})
	},
	
	

	logout(state) { //退出登录 
		console.log(state)
		state.userinfo = {}
		state.isLogin = false;
		uni.removeStorageSync('userinfo');
	},




}
const actions = {

}

export default {
	namespaced: true,
	state,
	mutations,
	actions
}
